<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>计算器</title>
    <link rel="stylesheet" href="css/index.css">
</head>
<body>
    <div id="calculator"></div>
    <script src="js/KeyBorad.js"></script>
    <script src="js/index.js"></script>
    <script>
        let kb = new KeyBoard("calculator");
        let cc = new Calculator();
        window.addEventListener("calc", function(str) {
            let expression = str.message;
            if (!expression) {
                return;
            }
            let result = cc.calc(expression);
            kb.setResult(expression, result);
        })
        
    </script>
</body>
</html>